package com.hducms.cms.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hducms.cms.dao.CmsCheckedDao;
import com.hducms.cms.entity.main.CmsChecked;
import com.hducms.cms.service.CmsCheckedService;

@Service
public class CmsCheckedServiceImpl implements CmsCheckedService {

	@Override
	public void save(CmsChecked bean) {
		dao.save(bean);
	}

	@Override
	public List<CmsChecked> getChecklistByContentId(Integer id) {
		return dao.getChecklistByContentId(id);
	}

	@Override
	public int isChecked(Integer cid, Integer uid) {
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("cid", cid);
		param.put("uid", uid);
		int result = dao.isChecked(param);
		if (result>0) {
			return 1;
		}
		else {
			return 0;
		}
	}
	@Autowired
	private CmsCheckedDao dao;

}
